package br.com.sol.persistencia.controle;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseOpenHelper extends SQLiteOpenHelper {
	public DatabaseOpenHelper(Context context, String name, CursorFactory factory, int version) {
		super(context, name, factory, version);
	}
	@Override
	public void onCreate(SQLiteDatabase db) {
        db.execSQL("CREATE TABLE CONTATO(id_contato INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(50), email VARCHAR(50), telefone VARCHAR(10), data_nascimento LONG, genero VARCHAR(20), relacionamento INTEGER);");
        db.execSQL("CREATE TABLE PERFIL(id_perfil INTEGER PRIMARY KEY AUTOINCREMENT, id_contato INTEGER);");
        db.execSQL("CREATE TABLE ATUALIZACAO(id_atualizacao INTEGER PRIMARY KEY AUTOINCREMENT, id_contato INTEGER, conteudo TEXT, data_postagem LONG);");
	}
	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
	}
}
